#!/usr/bin/env python
# coding: utf-8

"""
@file: http_test.py
@author: cg 
@date: 2020/2/27 11:53
@desc:  python模拟浏览器发起http请求
    
"""
import requests

# requests.get()
# requests.post()

# r = requests.get("http://www.baidu.com")
# print(r.text)

def get_all_news():
    """
    爬所有新闻
    :return:
    """
    url = 'https://www.hbfu.edu.cn/news/queryListForPage'
    r = requests.post(url, {"start":0, "limit":20000,"type":1},
                      verify=False)
    print(r.text)

def click_more():
    """
    对编号6417的新闻增加点击量
    :return:
    """
    for i in range(2000):
        url = 'https://www.hbfu.edu.cn/news/findById'
        requests.post(url,{"id":6421},verify=False)

click_more()
